<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/22
 * Time: 17:53
 */
namespace app\api\validate;

use think\Validate;

class Reg extends Validate
{
    protected $rule = [
        'username'   =>  'require|min:3',
        'password'   =>  'require|min:6|confirm',
        'phone'      =>  ['require','regex'=>'/^0?(13[0-9]|14[5-9]|15[012356789]|166|17[0-8]|18[0-9]|19[89])[0-9]{8}$/'],
        'sex'        =>  ['require','length'=>'1'],
        'birthday'   =>  'require',
    ];
    protected $message = [
        'username.require' => '用户名必填',
        'username.length'  => '用户名为英文时,不能小于三位',
        'password.require' => '密码必填',
        'password.confirm' => '两次密码输入不一致',
        'password.min'     => '密码不能小于6位',
        'phone.require'    => '手机号必填',
        'phone.regex'      => '请输入正确的手机号码',
        'sex.require'      => '性别必填',
        'sex.length'       => '性别输入有误',
        'birthday.require' => '出生日期必填'
    ];

}